package cate.game.common.time;

import cate.game.GameBody;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgOutput;
import cate.game.client.msg.id.MsgIdBCommon;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "服务器时间 の 通知")
public class TimeResp implements MsgOutput {

    @NoteField(value = "服务器当前时间", detail = "包含了服务器调试偏移时间")
    public long time;

    @NoteField(value = "服务器时间偏移量")
    public long offset;

    @NoteField(value = "服务器物理时间")
    public long timeRaw;

    public TimeResp(){
    }

    public TimeResp(GameBody game){
        this.time = game.time.now();
        this.offset = game.status.data.timeOffset;
        this.timeRaw = System.currentTimeMillis();
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBCommon.TIME_RESP;
    }
}
